/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Annuaire;

import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;


public class Client {

	public static void main(String[] args) throws Exception {

		Registry registry = LocateRegistry.getRegistry();

		AnnuaireInf ref_obj_distant = (AnnuaireInf) registry
				.lookup("Annuaire");
		
		
		Personne P1 = new Personne("Coquerelle","Mathias","0612761453","7bd du midi");
		Personne P2 = new Personne("Toto","Tata","0123456789","8 rue de la tour");
		
		System.out.println(ref_obj_distant.addContact(P1));
		System.out.println(ref_obj_distant.addContact(P2));
		
		try {
			System.out.println(ref_obj_distant.addContact(P2));
		} catch (NameException e) {
			// TODO Auto-generated catch block
			System.out.println(e.getComment());
		}
	}
}
